package com.sojson.controller.po.param.verify;

import java.sql.SQLException;

import com.sojson.entity.po.WorkExperience;
import com.sojson.result.Result;
import com.sojson.util.StringUtil;

/**
 * 活动表参数验证
 * 
 * @author liu
 * @date 2021-03-16
 */
public class WorkExperienceParamVerify {

    /**
     * 单条插入
     * 
     * @param workExperience
     * @return
     * @throws SQLException
     */
    public static Result<?> insert(WorkExperience workExperience) {
        if (StringUtil.isBlank(workExperience.getFirmName())) {
            return Result.fail("公司名称不能为空！");
        }
        if (StringUtil.isBlank(workExperience.getPost())) {
            return Result.fail("职位不能为空！");
        }
        if (StringUtil.isBlank(workExperience.getStartTime())) {
            return Result.fail("开始时间不能为空！");
        }
        if (StringUtil.isBlank(workExperience.getEndTime())) {
            return Result.fail("结束时间不能为空！");
        }
        if (StringUtil.isBlank(workExperience.getJobContent())) {
            return Result.fail("工作内容不能为空！");
        }

        return Result.success();
    }

    /**
     * 通过id更新(局部更新)
     * 
     * @param workExperience
     * @return
     * @throws SQLException
     */
    public static Result<?> updatePartialById(WorkExperience workExperience) {
        if (StringUtil.isBlank(workExperience.getId())) {
            return Result.fail("ID不能为空！");
        }

        return Result.success();
    }

}